// 导入创建仓库的依赖
import {createStore, combineReducers, applyMiddleware} from 'redux'
import userReducer from './user'
import orderReducer from './order'
import {composeWithDevTools } from 'redux-devtools-extension'
// 引入日志中间件
import {logger} from 'redux-logger'

// 声明一个最大的reducer
const rootReducer = combineReducers({
  // 模块名：模块内容
  user: userReducer,
  order: orderReducer
})


// composeWithDevTools  创建仓库时使用devTools
// applyMiddleware 使用中间件
const store = createStore(rootReducer, composeWithDevTools(applyMiddleware(logger)));

export default store